package designpatterns.singleton;

/**
 * 饿汉模式
 */
public class HungrySingleton {
    private static HungrySingleton instance = new HungrySingleton();

    // private 避免类在外部被实例化
    private HungrySingleton() {}

    public static HungrySingleton getInstance() {
        return instance;
    }
}
